[mirrors]
http://www.lua.org/ftp/lua-5.2.2.tar.gz
[main]
filesize=251713
sha512=7165c7c5cb5606abc6306338fac425604c2d432c9f1c6cef35d0cc353ebd4eb7e6ed7781d58fb1fedc4b9ac43f64055f57506d9b71d999278af9408c1f34f664

[deps]

[build]
sed -i "s@#define LUA_ROOT\t"'"/usr/local/"@#define LUA_ROOT "/"@' src/luaconf.h || exit 1
sed -i 's@INSTALL_TOP= /usr/local@INSTALL_TOP='"$butch_install_dir""$butch_prefix"'@' Makefile || exit 1

make -j$MAKE_THREADS MYCFLAGS="-fPIC $optcflags" MYLDFLAGS="$optldflags" linux || exit 1
make INSTALL_TOP="$butch_install_dir""$butch_prefix" install || exit 1
mkdir -p "$dest"/lib/pkgconfig
for subver in 1 2 ; do
cat << EOF > "$dest"/lib/pkgconfig/lua-5.${subver}.pc
majver=5
minver=$subver
relver=0
version=\${majver}.\${minver}.\${relver}
abiver=5.$subver

prefix=$butch_prefix
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
libname=lua
includedir=\${prefix}/include

INSTALL_LMOD=\${prefix}/share/lua/\${abiver}
INSTALL_CMOD=${prefix}/lib/lua/${abiver}

Name: lua
Description: Just-in-time compiler for Lua
URL: http://luajit.org
Version: \${version}
Requires:
Libs: -L\${libdir} -l\${libname}
Libs.private: -Wl,-E -lm -ldl
Cflags: -I\${includedir}

EOF
done
